<?php
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'basic';
$return=array();
/*******basic*******/
if($_RQ['op']=='basic'){
	$is_langs=str_array($this->setting['is_langs']);
	if($_RQ['postdata']){
		$postdata=get_postdata();
		$this->plugin_setting('diyset',$postdata);
		exi('设置成功');
	}
	$return['item']=$this->plugin_setting('diyset');
	$footernav = array(
			array('title'=>'首页','icon'=>'icon-shouye','color'=>'#cc99ff','action'=>'jy_weishop_en/index/','image'=>'../addons/jy_weishop/resource/images/jy_weishoparticle.png'),
			array('title'=>'推荐','icon'=>'icon-viewlist','color'=>'#66cc99','action'=>'jy_weishop_en/goods.index/','image'=>'../addons/jy_weishop/resource/images/jy_fenleimsg.png'),
			array('title'=>'搜索','icon'=>'icon-compass','color'=>'#ff9933','action'=>'jy_weishop_en/shop.groups/','image'=>'../addons/jy_weishop/resource/images/jy_fenleimsg.png'),
			array('title'=>'订单','icon'=>'icon-manageorder','color'=>'#66cc66','action'=>'jy_weishop_en/order.list/','image'=>'../addons/jy_weishop/resource/images/jy_fenleimsg.png'),
			array('title'=>'我的','icon'=>'icon-wo1','color'=>'#FF83FA','action'=>'jy_weishop_en/member.index/','image'=>'../addons/jy_weishop/resource/images/jy_fenleimsg.png'),
	);
	$jy_weishop_en=plugin('jy_weishop_en')->plugin_setting('basic');
	$jy_weishop_en['footernav']=$jy_weishop_en['footernav']?:$footernav;
	$htmls=array(
		'type'=>'edit',
		'desc'=>'设置内容',
		'edit_tab'=>true,
		'edits'=>array(),
	);
	foreach($is_langs as $en){
		$one=array();
		$one['title']=$this->langs[$en];
		$one['list']=array();
		$one['list'][]=array('type'=>'jsup','title'=>'一键翻译本页内容','action'=>'jy_lang_weishop/index/upfanyi/en='.$en,'message'=>'确定要一键翻译吗？这样将覆盖原有设置','btntitle'=>'一键翻译');
		foreach($jy_weishop_en['footernav'] as $k=>$fv){
			$one['list'][]=array('type'=>'stringdiy','title'=>$fv['title'],'name'=>$en.$k);
		}
		$htmls['edits'][]=$one;
	}
	if(!count($is_langs)){
		exi('基础设置--多语言开启--开启店铺语言（至少一个）,这里才显示内容','error');
	}
	$return['item']['fanyidata']=array();
	foreach($jy_weishop_en['footernav'] as $k=>$fv){
		$return['item']['fanyidata'][$k]=$fv['title'];
	}
	$return['htmls']=$htmls;
	exi($return);
}